package demo.vo.json;

import java.util.Date;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import demo.json.jackson.databind.Date2StringSerizlizer;
import demo.json.jackson.databind.LongJsonSerizlizer;
import demo.vo.Person;

/**
 * 
 *
 */
@JsonIgnoreProperties("lastName")
public class Student extends Person {

    private String studentName;

    private Integer studentAge;

    @JsonSerialize(using = LongJsonSerizlizer.class)
    private long score = Long.MIN_VALUE;

    @JsonSerialize(using = LongJsonSerizlizer.class)
    private Long tmp = Long.MAX_VALUE;

    @JsonSerialize(using = LongJsonSerizlizer.class)
    private Long bb;

    @JsonSerialize(using = Date2StringSerizlizer.class)
    private Date createAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateAt;

    public Date getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Date updateAt) {
        this.updateAt = updateAt;
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public Integer getStudentAge() {
        return studentAge;
    }

    public void setStudentAge(Integer studentAge) {
        this.studentAge = studentAge;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}